<template>
    <view :class="me.loginUserType == $enums.RefreshToken_LoginType.集团 ? 'showTabar' : 'hideTabar'">
        <u-row gutter="16" class="homeRow">
            <u-col span="4" v-for="(item, index) in menuList">
                <navigator class="box box1 marb-30" :url="item.url">
                    <view class="divCenterW marb-20">
                        <u-image width="80rpx" height="80rpx" mode="widthFix" :src="item.icon"></u-image>
                    </view>
                    <view class="textc">{{ item.name }}</view>
                </navigator>
            </u-col>
        </u-row>
    </view>
</template>

<script>
export default {
    data() {
        return {
            imgs_List: [],
            menuList: [],
            me: getApp().globalData,
        };
    },
    onLoad() {
        //获取七牛token
        let meData = getApp().globalData.permissions;
        let permissionsData = [
            {
                id: 50000,
                name: "状态监测",
                icon: "/static/imgs/ztjc.png",
                url: "/pages/stateMonitoring/index",
            },
            {
                id: 40100,
                name: "在用绳档案",
                icon: "/static/imgs/zysda.png",
                url: "/pages/ropeArchives/index",
            },

            {
                id: 40200,
                name: "专家评估",
                icon: "/static/imgs/zysda.png",
                url: "/pages/expertEvaluation/index",
            },
            {
                id: 40200,
                name: "换绳管理",
                icon: "/static/imgs/hsgl.png",
                url: "/pages/ropeManagement/index",
            },
            {
                id: 40300,
                name: "在用绳检测",
                icon: "/static/imgs/zysjc.png",
                url: "/pages/ropeDetection/index",
            },
            {
                id: 40400,
                name: "在用绳维保",
                icon: "/static/imgs/zyswb.png",
                url: "/pages/ropeMaintenance/index",
            },
            {
                id: 40500,
                name: "检测附件记录",
                icon: "/static/imgs/jcfjjl.png",
                url: "/pages/usingWireropeAttr/index",
            },
            {
                id: 30100,
                name: "库存管理",
                icon: "/static/imgs/kcgl.png",
                url: "/pages/inventoryManagement/index",
            },
            {
                id: 30500,
                name: "备绳维保",
                icon: "/static/imgs/bswb.png",
                url: "/pages/spareRopeMaintenance/index",
            },
        ];

        this.menuList = permissionsData.filter((f) => {
            return (
                this.$_.findIndex(meData, (x) => {
                    return x.perID === f.id && x.isPermission;
                }) > -1
            );
        });
    },
    onReady() {},
    methods: {
        submit() {
            //这里能获取到所有数据
            console.log(this.$gx.DeepCopy(this.processList));
        },
    },
};
</script>
<style scoped>
.homeRow {
    flex-wrap: wrap;
    margin: 0 auto !important;
    margin-top: 80rpx !important;
}
.homeRow ::v-deep .u-col {
    margin-bottom: 40rpx !important;
}
</style>
